package com.cci.kangdao.dao;


import com.cci.kangdao.dao.model.AppFunctionCategoryRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.mybatis.spring.annotation.MapperScan;

import java.util.List;
@MapperScan
public interface AppFunctionCategoryRecordMapper {


    int insertSelective(AppFunctionCategoryRecord record);

    AppFunctionCategoryRecord selectByPrimaryKey(Long id);

    @Update("update AppFunctionCategoryRecord_T set flag=-1  where UserId=#{userId} and ShowType=#{showType} and flag=0")
    int updateAppFunctionCategoryRecord(@Param("userId") long userId, @Param("showType") Integer showType);

    @Select("select * from AppFunctionCategoryRecord_T where UserId=#{userId} and ShowType=#{showType} and flag=0")
    List<AppFunctionCategoryRecord> selectList(@Param("userId") long userId, @Param("showType") Integer showType);

    @Select("select count(*) from AppFunctionCategoryRecord_T where UserId=#{userId} and ShowType=#{showType}")
    Long existFlag(@Param("userId") long userId ,@Param("showType") Integer showType);
}